package com.lib.model.enums;

/**
 * Created by duqingxiang on 17/5/25.
 */
public enum InstallmentStatusEnum {

    PREPAREED(0, "分期申请中"),
    UNCHECKED(1, "待补充"),
    UNCONFIRMED(2, "待确认"),
    ACCEPTED(3, "审核通过"),
    RETURNED(4, "审核退回"),
    CANCELED(-1, "已取消"),
    REJECTED(-2, "已拒绝");

    private int value;

    private String name;

    InstallmentStatusEnum(int value, String name) {
        this.value = value;
        this.name = name;
    }

    public int getValue() {
        return value;
    }

    public void setValue(int value) {
        this.value = value;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public static InstallmentStatusEnum valueOf(int value) {
        for (InstallmentStatusEnum status : values()) {
            if (status.value == value) {
                return status;
            }
        }
        return null;
    }

}
